﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AzureTosser.Services
{
    public class TossProviderFactory
    {
        private static TossProviderFactory mFactory;
        private static object mSyncRoot = new object();
        private TossProviderFactory() { }
        public static TossProviderFactory Instance
        {
            get
            {
                if (mFactory == null)
                {
                    lock (mSyncRoot)
                    {
                        if (mFactory == null)
                            mFactory = new TossProviderFactory();
                    }
                }
                return mFactory;
            }
        }
        private ITossBus mBus;
        private object mPadlock = new object();
        public ITossBus Bus
        {
            get
            {
                lock (mPadlock)
                {
                    if (mBus == null)
                        mBus = new POCImplementations.POCTossBus();
                    return mBus;
                }
            }
        }
    }
}